package lzyc.pointsManagement.business.config;

import lombok.Getter;

@Getter
public enum BizType {
    StudyGarden("0", "学园"), // 学园
    Course("1", "课程"), // 课程
    Activity("2", "活动"), // 活动
    Honor("3", "荣誉"), // 荣誉
    Notice("4", "公告");

    private final String code;
    private final String value;

    BizType(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static BizType fromCode(String code) {
        for (BizType status : BizType.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("No enum constant with code " + code);
    }
}
